/**
 * @file Alarm_Clock.c
 * @author Jasper
 * @brief
 * @version 0.1
 * @date 2024-12-10
 *
 * @copyright Copyright (c) 2024
 *
 */
#include "Alarm_Clock.h"
Struct_Alarm_Clock Alarm_Clock[NUM_OF_ALARM];
void Alarm_Check(Struct_Alarm_Clock *Tmp_Alarm, const CLOCK *Tmp_Current)
{
    if (Tmp_Alarm->Setting == On)
        if (Tmp_Alarm->Time.Month == Tmp_Current->Month &&
            Tmp_Alarm->Time.Day == Tmp_Current->Day &&
            Tmp_Alarm->Time.Hour == Tmp_Current->Hour &&
            Tmp_Alarm->Time.Min == Tmp_Current->Min)
        {
            Tmp_Alarm->Status = ring;
            Music_Start(Tmp_Alarm->Music);
        }
}

void Alarm_Modi_Setting(Struct_Alarm_Clock *Tmp_Alarm, Typedef_Alarm_Setting Tmp_Set)
{
    Tmp_Alarm->Setting = Tmp_Set;
}

void Alarm_Modi_Month(Struct_Alarm_Clock *Tmp_Alarm, unsigned char Month)
{
    Tmp_Alarm->Time.Month = Month;
}
void Alarm_Modi_day(Struct_Alarm_Clock *Tmp_Alarm, unsigned char day)
{
    Tmp_Alarm->Time.Day = day;
}
void Alarm_Modi_Hour(Struct_Alarm_Clock *Tmp_Alarm, unsigned char Hour)
{
    Tmp_Alarm->Time.Hour = Hour;
}
void Alarm_Modi_Min(Struct_Alarm_Clock *Tmp_Alarm, unsigned char Min)
{
    Tmp_Alarm->Time.Min = Min;
}
void Alarm_Reset(Struct_Alarm_Clock *Tmp_Alarm)
{
    Tmp_Alarm->Status = nring;
}
void Alarm_Modi_Song(Struct_Alarm_Clock *Tmp_Alarm, Typedef_Song Tmp_Song)
{
    Tmp_Alarm->Music = Tmp_Song;
}
Typedef_Alarm_Status Alarm_Get_Status(Struct_Alarm_Clock *Tmp_Alarm)
{
    return Tmp_Alarm->Status;
}
void Alarm_Copy(Struct_Alarm_Clock *Tmp_Alarm, Struct_Alarm_Clock *Tmp_Copy_Alarm)
{
    Tmp_Alarm->Music = Tmp_Copy_Alarm->Music;
    Tmp_Alarm->Setting = Tmp_Copy_Alarm->Setting;
    Tmp_Alarm->Status = Tmp_Copy_Alarm->Status;
    Tmp_Alarm->Time.Month = Tmp_Copy_Alarm->Time.Month;
    Tmp_Alarm->Time.Day = Tmp_Copy_Alarm->Time.Day;
    Tmp_Alarm->Time.Hour = Tmp_Copy_Alarm->Time.Hour;
    Tmp_Alarm->Time.Min = Tmp_Copy_Alarm->Time.Min;
}
//
